/**
 * UOMTypeComboBox is to be used to define a field type in an ItemClass
 * @author  zulianp@lu.unisi.ch & lemmar@lu.unisi.ch
 * @version 0.1
 */


package ch.unisi.inf.projects.java.uom.gui.itemclasseditor;

import javax.swing.JComboBox;
import java.util.Set;

import ch.unisi.inf.projects.java.uom.elements.*;
import ch.unisi.inf.projects.java.uom.*;


public final class UOMTypeComboBox extends JComboBox
{
    /** We are not going to serialize this class atm */
    private static final long serialVersionUID = -1L;
    
    public UOMTypeComboBox()
    {
        super();
        final ItemManager manager = ItemManager.instance();
        this.addItem(Constants.ITEM_CLASS_STRING.value());
        try {
            Set<ItemClass> itemClasses = manager.getItemClasses();
            for (final ItemClass c : itemClasses)
                this.addItem(c.getName());
        }
        catch (final Exception ex)
        {
            ex.printStackTrace();
            assert false;
        } 
    }

   
}
 